<template>
	<div>
		<el-card shadow="never">
			<!-- <h1>{{this.$router.currentRoute.name}}</h1> -->
			<el-table v-loading="loading" :data="tableData" style="width: 100%;margin-top: 20px">
				<el-table-column type="index" width="50"></el-table-column>
				<el-table-column label="用户ID" align="center" prop="userId"></el-table-column>
				<!-- <el-table-column label="用户名称" align="center" width="300" prop="userName"></el-table-column> -->
				<!-- <el-table-column label="组织机构" align="center" width="300" prop="schemeName"></el-table-column> -->
				<el-table-column label="IP地址" align="center"  prop="ip"></el-table-column>
				<el-table-column label="创建时间" align="center"  prop="createTime"></el-table-column>
			</el-table>
			<div style="margin-top: 20px;text-align: right">
				<el-pagination
					background
					@current-change="columnFind"
					:current-page="page.page"
					:page-size="page.pagesize"
					layout="prev, pager, next, jumper, total"
					:total="page.count"
				></el-pagination>
			</div>
		</el-card>
	</div>
</template>

<script>
	import Cookie from 'js-cookie';
import {systemLoginLogList } from '../../../../server/index.js'; //接口
export default {
	name: '',
	data() {
		return {
			tableData: [],
			page: {
				count: 0,
				pagesize: 10,
				page: 1
			},
			loading: true
		};
	},
	mounted() {
		var page = 1;
		this.columnFind(page);
		Cookie.remove('tabList');
	},
	methods: {
		columnFind(page) {
			const _this = this;
			_this.page.page = page;
			var obj = {
				page: _this.page.page,
				rows: _this.page.pagesize
			}
			this.http.request({
				url: systemLoginLogList,
				data: obj,
				success: function(res) {
					_this.loading = false;
					_this.tableData = res.list;
					_this.page.count = res.total;
				},
				error: function(err) {
					_this.$message({
						offset: '200',
						message: err.msg
					})
				}
			});
		}
	}
};
</script>

<style></style>
